package com.dark.base;

/**
 * ClassName: CloudErrorCodeEnmu
 * Description:CloudErrorCodeEnmu
 *
 * @author chengluchao
 * @date: 2022/8/13 3:58 PM
 * @since 1.4.8
 */
public enum FlowerFallingErrorCodeEnmu {
    SUCCESS(0, "success"),
    ERROR(-1, "系统异常"),
    METHOD_ARGUMENT_NOT_VALID_ERROR(1001, "参数校验失败"),


    // 用户模块
    ACCOUNT_HAS_BEEN_REGISTERED(2001, "账号已经被注册"),
    LOGIN_INFORMATION_ERROR(2002, "登陆信息错误"),
    LOGIN_INFORMATION_IS_INVALID(2003, "登录信息失效，请重新登录"),
    THE_ORIGINAL_PASSWORD_IS_WRONG(2004, "原密码错误"),



    // 文件模块
    FILE_PARSE_ERROR(3001, "文件解析异常"),
    FILE_NO_EXISTS(3002, "目标文件不存在"),
    NOT_AUTHORIZED_TO_READ(3003, "无权读取"),
    TASK_NUMBER_IS_ERROR(3004, "任务编号错误"),
    TASK_STATUS_ERROR(3005, "任务状态错误"),
    OPERATION_DATA_ERROR(3006, "这不是您的文件夹"),
    THIS_PATH_IS_NOT_A_DIRECTORY(3007, "此路径不是目录"),

    ;


    private int code;
    private String message;

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    FlowerFallingErrorCodeEnmu(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public static FlowerFallingErrorCodeEnmu getByCode(int code) {

        FlowerFallingErrorCodeEnmu[] var1 = FlowerFallingErrorCodeEnmu.values();
        int var2 = var1.length;

        for (int var3 = 0; var3 < var2; ++var3) {
            FlowerFallingErrorCodeEnmu errorEnum = var1[var3];
            if (errorEnum.getCode() == code) {
                return errorEnum;
            }
        }

        return null;
    }
}
